package com.desay.pangoo.itmt.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.desay.pangoo.itmt.entity.ProjectBUEntity;

/**
 * @author uidq1163
 */
@Repository
public interface ProjectBURepository
		extends JpaSpecificationExecutor<ProjectBUEntity>, PagingAndSortingRepository<ProjectBUEntity, Long> {

	/**
	 * 查询产品平台是否存在
	 * 
	 * @param productPlatform
	 * @return
	 */
	ProjectBUEntity findByProductPlatform(String productPlatform);

	@Modifying
	@Query(value = "delete from ref_project_platform_bu where bu_id =:id", nativeQuery = true)
	void deleteRefProjectPlatformByBuId(@Param("id") Long id);
}